<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>发布新闻 - 新闻发布系统</title>
    <link rel="stylesheet" href="css/style.css">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
    <style>
        .publish-container {
            max-width: 800px;
            margin: 2rem auto;
            padding: 2rem;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .publish-container h2 {
            color: #2c3e50;
            margin-bottom: 2rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid #3498db;
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: #2c3e50;
            font-weight: 500;
        }

        .form-group input[type="text"],
        .form-group textarea,
        .form-group select {
            width: 100%;
            padding: 0.8rem;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 1rem;
            font-family: inherit;
        }

        .form-group textarea {
            min-height: 300px;
            resize: vertical;
        }

        .form-group input:focus,
        .form-group textarea:focus,
        .form-group select:focus {
            outline: none;
            border-color: #3498db;
            box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
        }

        .submit-btn {
            padding: 1rem 2rem;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .submit-btn:hover {
            background-color: #2980b9;
        }

        .success-message {
            color: #27ae60;
            text-align: center;
            margin-top: 1rem;
            display: none;
        }

        .error-message {
            color: #e74c3c;
            text-align: center;
            margin-top: 1rem;
            display: none;
        }

        .btn-group {
            display: flex;
            gap: 1rem;
            margin-top: 2rem;
        }

        .btn-group .btn {
            flex: 1;
        }

        .btn-group .btn-secondary {
            background-color: #95a5a6;
        }

        .btn-group .btn-secondary:hover {
            background-color: #7f8c8d;
        }
    </style>
</head>
<body>
<header>
    <nav class="navbar">
        <div class="logo">
            <h1>新闻发布系统</h1>
        </div>
        <ul class="nav-links">
            <li><a href="index.html"><i class="fas fa-newspaper"></i> 查看新闻</a></li>
            <li><a href="publish.html" class="active"><i class="fas fa-edit"></i> 发布新闻</a></li>
            <li><a href="manage.html"><i class="fas fa-cog"></i> 新闻管理</a></li>
            <li><a href="login.html"><i class="fas fa-user"></i> 管理员登录</a></li>
        </ul>
    </nav>
</header>

<main>
    <div class="publish-container">
        <h2>发布新闻</h2>
        <form id="publishForm">
            <div class="form-group">
                <label for="title">新闻标题</label>
                <input type="text" id="title" name="title" required>
            </div>
            <div class="form-group">
                <label for="category">新闻分类</label>
                <select id="category" name="category" required>
                    <option value="">请选择分类</option>
                    <option value="technology">科技</option>
                    <option value="business">商业</option>
                    <option value="sports">体育</option>
                    <option value="entertainment">娱乐</option>
                    <option value="health">健康</option>
                </select>
            </div>
            <div class="form-group">
                <label for="content">新闻内容</label>
                <textarea id="content" name="content" required></textarea>
            </div>
            <div class="btn-group">
                <button type="submit" class="btn">发布新闻</button>
                <button type="button" class="btn btn-secondary" onclick="window.location.href='index.html'">取消</button>
            </div>
            <div class="success-message" id="successMessage">
                新闻发布成功！
            </div>
            <div class="error-message" id="errorMessage">
                发布失败，请重试
            </div>
        </form>
    </div>
</main>

<footer>
    <p>&copy; 2024 新闻发布系统 版权所有</p>
</footer>

<script src="js/publish.js"></script>
</body>
</html>